<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>景点订购</title>
		<script type="text/javascript" src="js/datepicker/WdatePicker.js"></script>
		<link type="text/css" rel="stylesheet" href="css/scenery/base.css" />
		<link type="text/css" rel="stylesheet" href="css/scenery/layout.css" />
		<link type="text/css" rel="stylesheet" href="css/scenery/booklist.css" />
		<link type="text/css" rel="stylesheet" href="css/scenery/order.css" />
		<link type="text/css" rel="stylesheet" href="css/scenery/form.css" />
	    <script type="text/javascript">
	        function calSumPrice(txtNum) {
	        	//document.write(document.getElementById("ticketPrice").innerHTML);
	        	price = document.getElementById("ticketPrice").innerHTML;
	        	amount1 =document.getElementById("amount"); 
	        	amount2 =document.getElementById("amount2"); 

	        	if(isNaN(txtNum.value)){
		            amount1.innerHTML = "必须输入数字";
		            amount2.innerHTML = "必须输入数字";
	        	}
	        	else{
	            amount1.innerHTML = txtNum.value * price;
	           	amount2.innerHTML = txtNum.value * price;
	           	}
	        }

	        function validate() {
	        	var play =document.getElementById("playDate"); 
	        	var take =document.getElementById("takeDate"); 

	        	if(play.value == '' ) {
		        	alert("请输入游玩日期");
		        	return false;
	        	}
	        	if(take.value == '' ) {
		        	alert("请输入取票日期");
		        	return false;
	        	}

	        	this.form.submit();
	        	return true;
	        	//return false;
		    }
	    </script>
	</head>

	<body>
		<div id="wrap">
			<jsp:include page="../head.jsp"></jsp:include>
			<div id="content">

				<div id="main" style="">
<div style="margin:20px 0;" >




</div>					
				</div>
				
				<!-- - xinxi -->
<div class="border">

	<form action="submitOrder.action" method="post" onsubmit="return validate()">
	<div id="div_consignee">
		<div class="kuang">
			<h3>
				订票人信息
			</h3>
			<div class="m_list">
				<span class="text"> 预订人：</span>
				<input type="text" name="order.trueName" value="${user.trueName}" id="trueName" maxlength="40"
					class="textbox_4" />
			</div>

			<div class="m_list">
					<span class="text">游玩时间:</span>
					<input id="playDate" name="order.playDate" type="text" class="Wdate textbox_4"
						onclick="WdatePicker()" readonly="readonly" size="25"
						onfocus="WdatePicker({dateFmt:'yyyy-MM-dd})" /><span></span>
			</div>	

			<div class="m_list">
					<span class="text">取票时间:</span>
					<input id="takeDate" name="order.takeDate" type="text" class="Wdate textbox_4"
						onclick="WdatePicker()" readonly="readonly" size="25"
						onfocus="WdatePicker({dateFmt:'yyyy-MM-dd})" /><span></span>
			</div>	
			
			<div class="m_list">
				<span class="text">电子邮箱：</span>

				<input type="text" name="order.address" value="${user.email}"
					id="address" maxlength="80" class="textbox_1" />
					<span class="m_list_notice">请务必正确填写您的邮箱，以方便联系。</span>
			</div>



			<div class="m_list">
				<span class="text">电话：</span>
				<input type="text"  name="order.tel" maxlength="40" value="${user.tel}"
					id="tel" class="textbox_4" />
			</div>


		</div>
	</div>

	

	<div id="div_payment">
		<div class="kuang">
			<h3>
				付款方式
			</h3>
			<ul>
				<li>
					<input type="radio" name="order.payType" value="网上支付" checked="checked">
					网上支付
				</li>
				<li>
					<input type="radio" name="order.payType" value="货到付款">
					货到付款
				</li>
				<li>
					<input type="radio" name="order.payType" value="邮局汇款">
					邮局汇款
				</li>
				<li>
					<input type="radio" name="order.payType" value="银行转帐">
					银行转帐
				</li>
			</ul>
		</div>
	</div>

	<div id="div_cartItems">
		<div class="kuang">
			<h3>
				景点清单
			</h3>

			<div id="div_order_all" class="">
				<div class="choice_bord">

	<h2 class="green14b" >您已选购的景点</h2>
	<div class="choice_bord">
	
		<table  class="tabl_buy" >
			<tr class="buy_title">
				<td>景点名</td>
				<td>市场价</td>
				<td>会员价</td>
				<td>数量</td>

			</tr>
			
			
				<tr bordercolor="gray" id="cart_${sceneryId}">
					<td><a target="_blank" href="viewScenery.action?sceneryId=${sceneryId}" title="${scenery.sceneryName}"><s:property value="scenery.sceneryName"/> </a></td>
					<td><span>￥${scenery.price+20} </span></td>
					<td><span class="orange12">￥<label id="ticketPrice">${scenery.price}</label> </span></td>
					<td>
						<input type="text"  value="1" name="order.number"
							maxlength="4" size="3" sceneryId="${sceneryId}" onkeyup="calSumPrice(this);"/>
						<input type="hidden" name="sceneryId" value="${sceneryId}" />
						<input type="hidden" name="order.price" value="${scenery.price}">
						<input type="hidden" name="order.memberId" value="${user.memberId}" />
						<input type="hidden" name="order.sceneryName" value="${scenery.sceneryName}" />
					</td>

				</tr>
				
		</table>
		
		<div class="dashed1"></div>		
		<div><span class="black14b">金额总计：</span><span class="orange14b">￥<span id="amount">${scenery.price}</span></span> </div>

	</div>

				</div>


				<div class="dashed1"></div>
				<div>
					<span class="black14b">您需要为订单支付：</span><span class="orange14b">￥<span
						id="amount2">${scenery.price}</span> </span>
				</div>
			</div>

			<!--增加div_order_part区域-->
			<div id="div_order_part" />

				<div class="order_refer" style="text-align: center;">
					<span >请核对以上信息，点击“提交订单”</span>
					<input type="image" src="images/jrjs.gif" onclick="" alt="提交订单" />
				</div>
					<div style="padding:20px 0;">

	</div>
			</div>
		</div>
	</div>
	</form>
</div>				
				
				<!--  end xinxi -->
				
	<div class="clear1"></div>
	<div id="footer">
		<jsp:include page="../bottom.html"></jsp:include>
	</div>
			</div>
	</body>
</html>